# @summary A short summary of the purpose of this class
#
# A description of what this class does
#
# @example
#   include csns::dgzabbix
class csns::dgzabbix {
    case $architecture{
	'x86_64':{
	yumrepo { 'zabbix':
                baseurl  => "http://mirror.csns.ihep.ac.cn/zabbix/zabbix/5.0/rhel/\$releasever/\$basearch/",
                descr    => "zabbix",
                enabled  => 1,
                gpgcheck => 0,
                priority => 20,
                before   => Yumrepo['site'],
        }
	 package{'zabbix-agent':
#                ensure => installed,
                ensure => '5.0.30',
                require => Yumrepo["zabbix"],
        }

	}

	'aarch64':{
	package{'zabbix-agent':
#		ensure => installed,
		ensure => '5.0.30',
#		require => Yumrepo["csnspuppet"],
        }
	
	}
    }	

	file {'/etc/zabbix/zabbix_agentd.conf':
      		 content => template("csns/zabbix_agentd_conf.erb"),
		ensure => file,
	}

	service {'zabbix-agent':
		ensure =>"running",
		hasstatus => true,
		enable => true,
		subscribe => [File["/etc/zabbix/zabbix_agentd.conf"]],
        }
}
